Skip to content

Sheffield | May-2025 | WALEED-YAHYA SALIH-TAHA | Sprint-2 #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Bluejay600
Copy link

@Bluejay600 Bluejay600 commented Jun 30, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

I have corrected the errors, debugged and implemented the functions in sprint-2 folder. also interpreted the given codes and tested them as well.

Questions

Ask any questions you have for your reviewer.

…bug section.

2. corrected the code in the three files.
2. explained the errors messages .
3. corrected the code and fixed the problems.
@Bluejay600 Bluejay600 added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Participant to add when requesting review labels Jun 30, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are also exercises in Sprint-2/3-mandatory-implement and Sprint-2/4-mandatory-interpret.

  • Can you also include a brief description of your PR under "Changelist"?
    image

  • Why not practice "committing files one by one, on purpose, and for a reason"?
    In VSCode, you can select which file to stage, and commit only the staged file.
    See: https://www.youtube.com/watch?v=z5jZ9lrSpqk&t=705 (At around 12:50 minute marker, the video shows how to stage a single file).

Comment on lines 24 to 30
function convertToPercentage(decimalNumber) {
decimalNumber = 0.5; // Remove 'const' to avoid redeclaration
const percentage = `${decimalNumber * 100}%`;

return percentage;
}
console.log(convertToPercentage(0.5)); // Output: "50%"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also execute the following statement to see if it produce the output you expected?

console.log(convertToPercentage(0.1));

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it gives me the same result, because the decimalNumber was declared above so the program ignores the (0.1).
I have now removed the value, so it takes what I have wrote down in thee console.log

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 3, 2025
Bluejay600 added 11 commits July 4, 2025 09:07
2. called the function with input string
3. the function returns the string in UPPER_SNAKE_CASE.
…reusable block of code.

2. declared a function (toPounds) with parameter name.
3. I called the function 3 times.
…reusable block of code.

2. declared a function (toPounds) with parameter name.
3. I called the function 4 times.
2. Answered the questions clearly and excuted the code to see the results.
2. tested the code to see the correct result as expected
@Bluejay600 Bluejay600 added Needs Review Participant to add when requesting review and removed 📅 Sprint 2 Assigned during Sprint 2 of this module Reviewed Volunteer to add when completing a review labels Jul 5, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you double check questions (b) and (c) in Sprint-2/4-mandatory-interpret/time-format.js? I will mark this PR as completed first.

Comment on lines 27 to 32
// The value assigned to num when pad is called for the first time is 1. This is because totalHours is calculated as (61 - 1) / 60, which equals 1.
// The first call to pad is for totalHours, which is 1.

// c) What is the return value of pad is called for the first time?
// =============> write your answer here
// The return value of pad when called for the first time is "01". This is because pad converts the number 1 to a string and pads it with a leading zero to ensure it has at least two digits.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer is not 1. You can add a console.log(num); after line 1 (but before the return statement), and execute the script to find out.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I can see now, I found the answer is 0., I updated the answer now.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review labels Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants